﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bootstrap.MVC.Common;
using Bootstrap.MVC.Utils;

namespace Bootstrap.MVC.Widgets
{
    public class ButtonGroupBuilder : WidgetBuilderBase<ButtonGroupModel, 
                                           ButtonGroupBuilder, 
                                           ButtonGroupHtmlGenerator,
                                           ButtonGroupScriptGenerator>
    {
        public ButtonGroupBuilder(ButtonGroupModel model,
                             ButtonGroupHtmlGenerator htmlGenerator,
                             ButtonGroupScriptGenerator scriptGenerator )
            : base(model, htmlGenerator, scriptGenerator) { }


        public ButtonGroupBuilder(ButtonGroupModel model) : base(model) { }


        #region Public Methods
        public ButtonGroupBuilder Buttons(Action<ButtonFactory> builder)
        {
            var buttonFactory = new ButtonFactory(Model);
            builder(buttonFactory);

            return this;
        }

        public ButtonGroupBuilder Bind(IEnumerable<IButtonModel> buttons)
        {
            Model.Buttons = buttons.ToList();
            return this;
        }
 
        #endregion Public Methods


    }


    
}
